#version 460





layout(location = 1) in VS_FS_VERTEX {
	flat vec4	vColorA;
	flat vec4	vColorB;
	flat vec2	Gradient;
	vec2		UV;
};

layout(location=0) out vec4 outColor;


layout(binding = 10) uniform sampler2D tex;

void main(void){
	//vec2 coord = vec2(gl_PointCoord.x*gImageWidthScale, gl_PointCoord.y);
	outColor = textureLod(tex, UV, 0);

	vec2 g = Gradient * UV;
	float z = dot(g, vec2(1, 0));
	vec4 c1 = mix(vColorA, vColorB, g.x);
	vec4 c2 = mix(vColorA, vColorB, g.y);
	vec4 backColor = (c1 + c2) * 0.5;
	
	//outColor = backColor;
	//return;
	//outColor = texelFetch(tex, UV, 0);
	//outColor = textureLod(tex, vec3(gl_PointCoord, 1), 0);
	//outColor = vec4(0, m_InstanceCoord[gCoordInstance], 0, 1);
	
	//outColor.r += 0.5;
	//outColor = mix(backColor, outColor, outColor.a);
	outColor.a = 1.0;
}


